package com.dk.config;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118621173";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "\n" +
            "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCRfuNQmx4RH99tggo8OfVa88GVQ9ITEXvNOC3l2RkheYfKQGXWievxkxqvjUMi1wUGs6Csg5SZUtW5qV6lIizLv8ZbRht4xYeLS1CwkKeWJAn+jP0JdDraEI1NoAEMjWveCO+TyCWo6TLzSKTDdim+S+n3wnTf2ejbHBqqPPxuemtyr57Uc18N4Ta6z/m7FrYbPpFhcqPS1npKv/Ei1jHyoocaReNql4Ob4WhQHnIPATUyVt/wNJT+17u0PhvC3ltk7r2ylXSXosmqwLyVzTwUQOe1DIMjWfX/LkG5oyxcYq1as14BycQtfGRroDuKvVUnkmvosyc0AZPFxnwwEA3tAgMBAAECggEAXdbmC84QJWFWPI37xf5ntgKzX28/pdbH74OFbtKH9+QnZZYFWMrZ55RGSOWmYGkoL7tZLQsso3sep8GKbp1NIRiOeb4M5+cW1gt8fnS98gNKgugyJ4/UiWLVkDRbmNn5sVo4EyuqxnepyemXgw3KPJc/zvGXae1k1zUYKaZt9V58n9hCWYb2Z3OpD6SJPZOBfr/R6W1i48HmLtS43BHG2OoZfWEa4J1ZBOCI1CDCImWq9V1TU4MA8Bbf45UQ53dQ8ZJ+bbzBIklwxYCxUJpc9/Vt0eNfoamKd2ZSco2WPu4uqBX2nezAaNjS4OjPinDJOrZleG9aS1N7juN9SqUlTQKBgQDIXwIlKSELCp9or0R5nDwdSC5NRzIf9dWXNCgyJY/uYPxiC9/e1Hs3NmlEbc3/gdDZYb3K2W61rPY+KWa8VlshQADzxSRjYfVBzxvcBIxNe68ot8VQoqXnBQ1G3q9exjldBOwhb15yxKhJ/rg3MCE7fwOLUNbyKH6GT9rrOhwcNwKBgQC547YWG8tDhLzKQH4qNYltkuZNjh9Gf51D0UJVdouAc0IQyEwt9zltFOcv2oc1UeQz5Yb/7DM+NjKr0SBsNLBhq1fQHaTSAqkxpREL5kUbhVA/NWC42L6xXnSGAk0HI0rNatIXcMeLJ3KgWOK1dgyvf3xNE8taj4BeyljGaHi8+wKBgQC4FzItWiBVuKjE0WKkKHrCnHKN5X+UBZT7mpvjlscqSEkY+7fvTmD2VTNZ/1hoC6kKT9bD7AjfOc3zRq5xExYe8mLtlI7eED34/IOoHTWaaqx/SHgsoYKzQdz049tTw+MoJ0GbZmrsHupPMYumiL2/n+5trRQO4E1+sRd9TqJM+QKBgQCecFL7xxbZ5qJPNOcULOuExGedhNxtZ0nwysRiOZcvlY2i5kXgC88bhWyDYhxKOxFplmIZcgY/KUzJG4cqE0KfDL7c+NdJ1NDHKq072jne+iLqrSFSjBME9MAWlJF42wDf0wNczViW57mQqBIbnpGzZ9LXk16JQrSklo1SFyuJzwKBgEguv43Wqlfl6p6Z5rlaUC9YTtliYE8uJL9l3bXIbERFFf3KR1avqk/0/YsVJeCSKfnsBUOViH/Fiz8+19Hf4hq8LAC4ksJ6O49frOYiPSXehKFgrBiteKDykaqJcbSXJMuTG+YXrgOgISr7oxOhmtCN+cHBO5nxKkE16bPbsVQz";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr9i3U+u+SbcDNiKfpYsVHMTMcTGeQ4bmYkxqdEv14zcrxb+wO5hC1UzaaMJI2+pczqkWpgfWkVJNRPrQjrO0stfyizWBmrc17j+Te+8NOq8bpAl1nLpX5a2T8YTZ2DzWAKNMjFprz5bKmUM4M90Q4Q9xz+C4Cvsw+g1dsMt6BhJ7HO2cOBib2A7DGf3btLNmc2kdmd+8d5cA7fL8vDEge10ZHT5J1rSXCdr2eGI32lFFlmLHX1CB03e25Oiehcv6xX3/DSjhHpdd54Nat2kraxjgiiX823tPno748BCJxuLBlC3Zz1RQ4VpOIW5yDkl58QbmRHf4urzj9lI3nLUGLwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://4a3736r068.zicp.vip:51624/alipayCallback/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://4a3736r068.zicp.vip:51624/alipayCallback/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志
    public static String log_path = "E:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}